<!doctype html>
[#escape x as (x)!?html]
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <title>${channel.seoTitle!channel.name} - ${site.seoTitle} - Powered by JPROCMS</title>
  <meta name="keywords" content="${channel.seoKeywords!site.seoKey}">
  <meta name="description" content="${channel.seoDescription!site.seoDesc}">
  [#include '../includes/common_res.html'/]
</head>
<body>
[#if config.grade>1&&!dynamic]
  <!--# include file="/${site.sitePathPrefix}/includes/header.html" -->
[#else]
  [#include '../includes/header.html'/]
[/#if]
<div class="bg-gray-200">
  <div class="container">
    <nav class="row" aria-label="breadcrumb">
      <ol class="col list-inline my-2">
        [#assign parent = channel.parent!channel/]
        <li class="list-inline-item"><a class="btn btn-sm [#if parent.id == channel.id]btn-primary[#else]btn-link[/#if]" href="${parent.url}">全部</a></li>
        [@ZChannelList parentId=parent.id; list]
          [#list list as c]
            <li class="list-inline-item"><a class="btn btn-sm [#if channel.id == c.id]btn-primary[#else]btn-link[/#if]" href="${c.url}">${c.name}</a></li>
          [/#list]
        [/@ZChannelList]
      </ol>
    </nav>
  </div>
</div>
<div class="container">
  <div class="row">
    <div class="col-lg-8 mt-2">
      [#assign customsQueryMap={}/]
      [#list channel.contentModel.fieldList?filter(field->['radio','checkbox','select','multipleSelect']?seqContains(field.type)) as field]
        <div class="py-1 border-bottom">
          [#assign param=field.code+'_cus'/]
          <a href="${ZParamsJoin(channel.url, channel.dynamicUrl, param)}" class="btn btn-sm[#if !Params[param]??] btn-secondary[#else] btn-link text-reset[/#if]">全部${field.name}</a>
          [@ZDictList type=field.dictType; list]
            [#list list as dict]
              <a href="${ZParamsJoin(channel.url, channel.dynamicUrl, param, dict.value)}"
                 class="btn btn-sm [#if Params[param]! == dict.value]btn-secondary[#else]btn-link text-reset[/#if]">${dict.label}</a>
            [/#list]
          [/@ZDictList]
        </div>
        [#assign customsQueryMap=customsQueryMap + {'EQ_'+param: Params[param]!}/]
      [/#list]
      [@ZContentPage channelId=channel.id includeChildChannel="true" customs=customsQueryMap orderBy="top_level_desc,release_time_desc"; pageResult]
        <ul class="list-unstyled">
          [#list pageResult.list as content]
            <li class="mt-3 media position-relative pb-3 border-bottom">
              [#if content.sysImage??]<img src="${content.sysImage}" class="mr-3 img-thumbnail" width="48" height="48" alt="${content.title}">[/#if]
              <div class="media-body">
                <p class="mt-0 mb-1">[@ZUrl object=content class="text-reset stretched-link"]${content.title}[/@ZUrl]</p>
                <p class="small text-muted d-none d-sm-block mb-2">${ZSubstring(content.description,80,'...')}</p>
                <div class="small text-muted mt-2 clearfix">
                  <div class="float-left">
                    <span>[#list content.channel.nodeList as n][@ZUrl object=n/][#if n_has_next] > [/#if][/#list]</span>
                    <i class="ml-2 fas fa-download"></i> ${content.downloads}
                  </div>
                  <div class="float-right"><i class="ml-2 far fa-clock"></i> ${ZFormat(content.releaseTime, 'yyyy-MM-dd')}</div>
                </div>
              </div>
            </li>
          [/#list]
        </ul>
        [#include '../includes/inc_page.html'/]
      [/@ZContentPage]
    </div>
    <div class="col-sm-4 mt-3 px-4 d-none d-lg-block">
      <h5 class="border-bottom"><span class="border-primary common-block-head-bottom">下载排行榜</span></h5>
      <div class="px-2 pb-2 mt-3">
        [@ZContentList channelId=channel.id includeChildChannel='true' orderBy='count.downloads_desc' count='10';list]
          [#list list as content]
            <div class="mt-2 d-flex flex-row">
              <div><span class="badge [#if content_index < 3]badge-primary[#else]badge-secondary[/#if]" style="width:26px;">${content_index+1}</span></div>
              <div class="ml-2 flex-grow-1 text-truncate">[@ZUrl object=content class="text-reset"/]</div>
              <div class="text-muted">${content.downloads}</div>
            </div>
          [/#list]
        [/@ZContentList]
      </div>
    </div>
  </div>
</div>
[#if config.grade>1&&!dynamic]
    <!--# include file="/${site.sitePathPrefix}/includes/footer.html" -->
[#else]
    [#include '../includes/footer.html'/]
[/#if]
<script>axios.get('${api}/channel/view/${channel.id?c}');</script>
</body>
</html>
[/#escape]
